<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/9 0009
 * Time: 下午 3:00
 */
namespace app\index\validate;

use think\Validate;

class Vregist extends Validate
{
    protected $rule = [
        'username'=>'require|max:20|unique:member',
        'password'  =>  'require|min:6',
        'repassword'=>'require|confirm:password',
        'email' =>  'require|email|unique:member_content',
        'code'=>'number',

    ];

    protected $message = [
        'username.require'=>'账号不能为空',
        'username.max'=>'账号字数设置不能超过20位',
        'username.unique'=>'该账号已经注册',
        'password.require'  =>  '密码不能为空',
        'password.min'=>'密码不得少于6位',
        'repassword.require'=>'确认密码不能为空',
        'repassword.confirm'=>'两次输入密码不一致',
        'email.require' =>  '邮箱不能为空',
        'email.email' =>  '邮箱格式错误',
        'email.unique' =>  '邮箱已被注册',
        'code'=>'验证码必须是数字'
    ];

    protected $scene = [
        'add'   =>  ['email','password'],
        'edit'  =>  ['email'],
    ];
}